<?php
/**
* @package Pages-and-Items (com_pi_pages_and_items)
* @version 1.5.7
* @copyright Copyright (C) 2006-2010 Carsten Engel. All rights reserved.
* @license http://www.gnu.org/licenses/gpl-2.0.html GNU/GPL
* @author http://www.pages-and-items.com
*/

//no direct access
if(!defined('_VALID_MOS') && !defined('_JEXEC')){
	die('Restricted access');
}


$pageId = 0;

//give headers in Joomla 1.5 a bit more spunk
$class_pi->spunk_up_headers_1_5();

?>

<table cellspacing="0" cellpadding="0" border="0" width="100%">
	<tr>
		<td  valign="top" width="25%">
		<?php
			$class_pi->pages();
		?>
		</td> 
		<td valign="top">
			<form name="adminForm" method="post" action="">
			<input type="hidden" name="option" value="com_pi_pages_and_items" />
			<input type="hidden" name="task" value="rootSave" />
			<input type="hidden" name="pageId" value="0" />
			<table cellspacing="0" cellpadding="0" border="0" width="100%">
				<tr>
					<td valign="top" width="49%">
						<table class="adminform">
							<tr>
								<th>
									<?php 
										echo _pi_lang_pagesroot.$class_pi->get_menutype_title($class_pi->current_menutype);
									?>
								</th>
							</tr>
							<tr>
								<td>
									<?php
										$class_pi->underlyingPages();
									?>
								</td>
							</tr>
						</table> 		
					</td> 
					<td width="2%">&nbsp;
					
					
						
					</td>
					<td valign="top" width="49%">&nbsp;
							
						<?php
						
							
							
							$database = JFactory::getDBO();
							
							/*
							jimport( 'joomla.filesystem.folder' );
							class find_and_replace{
							
								public $source_dir = '_find_and_replace1';
								public $target_dir = '_find_and_replace2';
								
								function find_and_replace(){	
									$this->folders($this->source_dir);									
								}
								
								function file_find_and_replace($file){
									
									if (!$fp = @fopen(JPATH_ROOT.DS.$file, "r")) {			
										die('not reradable');
										return false;
									}						
									$filename = JPATH_ROOT.DS.$file;					
									$fstring = fread($fp, filesize($filename));
									fclose ($fp);
									
									$fstring = $this->do_string_replacement($fstring);																	
																	
									$target = str_replace($this->source_dir, $this->target_dir, $file);									
									
									if (!$fp = @fopen(JPATH_ROOT.DS.$target, "wb")) {			
										die('can not write file');
									}
									fputs($fp, $fstring, strlen($fstring));
									
									fclose ($fp);								
									
								}
								
								
								
								function files($currentfolder){
									$files = JFolder::files(JPATH_ROOT.DS.$currentfolder);	
									foreach($files as $file){
										echo 'file= '.$currentfolder.DS.$file.'<br />';
										$this->file_find_and_replace($currentfolder.DS.$file);
									}
								}
								
								
								function folders($currentfolder){									
									
									$this->files($currentfolder);								
									$folders = JFolder::folders(JPATH_ROOT.DS.$currentfolder);								
									foreach($folders as $folder){
										echo 'dir= '.$folder.'<br />';										
										$this->folders($currentfolder.DS.$folder);
									}
								}	
								
								function do_string_replacement($string){														
									
									$lines = explode("\n", $string);
									
									$freshlines = '# language file for component Frontend-User-Access
# www.pages-and-items.com
# Copyright (C) 2010. All rights reserved.
# License http:#www.gnu.org/licenses/gpl-2.0.html GNU/GPL, see license.txt
# Note : All ini files need to be saved as UTF-8

';
									
									foreach($lines as $line){
										//filter stuff
										if(strpos($line, '=')){											
											
											$temp = $line;											
											$pos = strpos($temp, '=');
											$varname = substr($temp, 0, $pos); 
											$varname = str_replace('COM_FRONTENDUSERACCESS_','',$varname);
											
											
											$value = substr($temp, $pos+1, 999); 											
											$value = trim($value);	
											$value = str_replace('"','',$value);
																					
											
											$freshline = $varname.'='.$value;
											
											$freshlines .= $freshline."						
";
											
										}
									}	
									$freshlines .= "SECTION_ACCESS=section access
SECTIONS_ACTIVE=activate section access restrictions
NO_SECTIONS_ACTIVE=Section access restrictions are not activated
SECTION_ACCESS_SAVED=section access restrictions are saved
ITEMS_INFO2=You can change this message in the language file
SECTIONS_INFO=Frontend article access for all articles in specific sections
MESSAGETYPE_SECTION=message type when no access to articles (belonging to the section) in full article view
INSTRUCTIONS=instructions
OPENS_IN_POPUP=opens in popup
ITEMS_HIDE_INFO=To hide the article completely, Frontend-User-Access needs to know which CSS class-names are used in your template. If you are using a variation of the default templates provided in the Joomla destribution, just press a template-button underneath.
ITEMS_HIDE_INFO2=If you are using any other template, you need to check the code and enter the classnames here. On your site, go to a page which shows one or more articles and check the HTML output. Enter the CSS classnames in the fields provided.
HIDE_WRAPPER_CONTENT=element and classname wrapper of content or article-wrapper. example:
HIDE_WRAPPERS_UP=element and classname sibling wrappers above the content-wrapper<br />Often the wrapper for the article-title or wrapper for buttons. If there is none, leave empty. If there are more, order them starting from the content-wrapper. example:
HIDE_WRAPPERS_DOWN=element and classname sibling wrappers below the content-wrapper<br />Often the wrapper for the article-separator. If there is none, leave empty. If there are more, order them starting from the content-wrapper. example:
JOOMLA10_ONLY=This hide-article configuration is only for Joomla 1.0
REDIRECT_ID_INFO=here you can enter an id of an article, section or category. This can then be used to redirect the user to his/her own page after login. Read more about redirection on page 'configuration' > tab 'usergroups' > usergroup_name
OLD_MODULE_INFO=Module restrictions from a previous installation (FUA version 1 or 2) have been found in your database
OLD_MODULE_INFO2=Frontend-User-Access used to work with setting restrictions on a FUA-module. That FUA module could then be configured to load any other module by id. In this new version of FUA, you can set access directly on the modules themselves. So you don't need to load a module into a FUA module any more. The module restrictions in this version are directly for each module. Because of these changes in module access management, you need to re-configure you module access restrictions here. Underneath are the module access settings from your previous install, so you can re-create them here. Please note that in the previous versions the FUA wrapper module loaded the module, so you need to set those modules to the position and order of the FUA-wrapper-module in which the module was loaded. Do not forget to enable the module and disable the FUA wrapper module for each row. Please note that if where previously using 'reverse access', each selected box means the user had NO access
NO_OLD_DATA_FOUND=no old module access restrictions found. The old module-access table is present, but is empty. You can delete the old table using the button underneath
DONE_UPDATING_DELETE_OLD_TABLE=I am finished updating the module access restrictions, delete the old table and don't show this message again
OLD_WRAPPER_DATA=[fua-module-id] fua-module-name ([module-id] module-name)
SURE_DELETE_MODULE_TABLE=are you sure you want to delete the old module table? Only super administrators are allowed to do this
OLD_MODULES_TABLE_DELETED=the old modules table is successfully deleted
JOOMLA_ACCESS_LEVELS=Joomla access levels
SELECT_ON_REGISTRATION_PAGE=select on registration page
ENABLE_SELECT_TO_GROUP_UPDATE=Use the above code also for the account update form
REGISTRATION_FORM=code to be used when processing registration form
UPDATE_FORM=code to be used when processing update form
";								
									$freshlines .= "#lang_end";
									//echo $freshlines;
									$string = $freshlines;
									
									
									return $string;
								}						
								
								
							
							}
							$class_obj_find_and_replace = new find_and_replace();	

							*/
						
							?>
			
				
					
					
					
							
											
					</td>
				</tr>  
			</table>
			</form>
		</td>
	</tr>
</table>
<?php
	$class_pi->display_footer();	
?>	
	